﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAccessLayer
{
    public class RoleRepository
    {
        StationeryInventoryEntities1 ent;

        public RoleRepository()
        {
            ent = new StationeryInventoryEntities1();
        }

        #region Select Method

        public Role GetRoleByRoleId(int roleId)
        {
            Role role = new Role();

            var r = ent.Roles.FirstOrDefault(x => x.RoleID == roleId);

            if (r != null)
            {
                role = r;
            }

            return role;
        }

        #endregion

    }
}
